//
//  main.m
//  Home-2 - 完成分数练习
//
//  Created by 岁变 on 16/7/5.
//  Copyright © 2016年 岁变. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Fraction.h"

int main(int argc, const char * argv[]) {
    
    Fraction *fra1 = [Fraction FractionWithNumerator:1 denominator:2];
    
    Fraction *fra2 = [Fraction FractionWithNumerator:1 denominator:4];
    
    //比较
    [fra1 compareWithFraction:fra2];
    
    //加法
    Fraction *newFra1 = [[Fraction alloc] init];

    newFra1 = [fra1 addWithFraction:fra2];
    
    [newFra1 release];
    
    NSLog(@"%ld/%ld", newFra1.numerator, newFra1.denominator);
    
    //减法
    Fraction *newFra2 = [[Fraction alloc] init];
    
    newFra2 = [fra2 deWithFraction:fra1];
    
    [newFra2 release];
    
    NSLog(@"%ld/%ld", newFra2.numerator, newFra2.denominator);
    
    //乘法
    
    Fraction *newFra3 = [[Fraction alloc] init];
    
    newFra3 = [fra1 mulWithFraction:fra2];
    
    [newFra3 release];
    
    NSLog(@"%ld/%ld", newFra3.numerator, newFra3.denominator);
    
    //除法
    Fraction *newFra4 = [[Fraction alloc] init];
    
    newFra4 = [fra1 divWithFraction:fra2];
    
    [newFra4 release];
    
    NSLog(@"%ld/%ld", newFra4.numerator, newFra4.denominator);
    
    //约分在加减乘除的方法里有

    
    return 0;
}
